package com.ttx.pattern.example.observer.after;

import com.ttx.pattern.example.observer.after.observers.ReaderA;
import com.ttx.pattern.example.observer.after.observers.ReaderB;

/**
 * @author TimFruit
 * @date 2019/5/21 14:11
 */

public class Client {
    public static void main(String[] args) {
        Magazine magazine=new Magazine();

        ReaderA readerA=new ReaderA();
        magazine.registerObserver(readerA);
        ReaderB readerB=new ReaderB();
        magazine.registerObserver(readerB);
        magazine.updateContent("第一章");
        
        magazine.removeObserver(readerA);
        magazine.updateContent("第二章");
    }
}
